//***************************************************************************//
//* 版权所有  www.sh-easy.com
//*
//* 当前版本：V1.0		
//* 作    者：zhfayuan
//* 完成日期：2015-12-26
//**************************************************************************//
#if !defined(SDEVENTGROUP_H)
#define SDEVENTGROUP_H
#include "SDCommon.h"
#include "SDEvent.h"

#define  MAX_MESSAGE_COUNT     512

#ifndef ANDROID
using namespace std;
#endif

class CSDEventGroup
{
public:
	CSDEventGroup();
	virtual ~CSDEventGroup();

public:

	void RegisterMessage(UINT nMessageId);
	BOOL wait(UINT nMessageId);
	BOOL waittime(UINT nMessageId, int dwMilliseconds);
	BOOL post(UINT nMessageId);

private:
	CSDEvent  *FindEvent(UINT unMsgId);
#ifdef ANDROID
	CSDEvent  *m_eventGroup[MAX_MESSAGE_COUNT];
#else
	map<UINT, CSDEvent *>  m_eventGroup;
#endif
	void                   *m_cs;
};

#endif // !defined(SDEVENTGROUP_H)
